# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=py3-gnupg
pkgver=0.5.3
pkgrel=0
pkgdesc="Python3 wrapper for the Gnu Privacy Guard (GPG or GnuPG)"
url="https://gnupg.readthedocs.io/en/latest/"
arch="noarch"
license="BSD-3-Clause"
depends="python3 gnupg"
makedepends="py3-setuptools py3-wheel py3-gpep517 py3-installer"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://pypi.io/packages/source/p/python-gnupg/python-gnupg-$pkgver.tar.gz"
builddir="$srcdir/python-gnupg-$pkgver"
options="!check" # hang

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
88a2d754df7265aefac6b9a0651c7e933125ba7f8170bda7e867f5dd8bb54272609c26d0ce17a15afa7710baebe06fa3ab211e2af1d1d84eb1f1c65ba7a1dd6a  python-gnupg-0.5.3.tar.gz
"
